Ext.namespace('Ext.xredman');

Ext.xredman.Person = function(){
	this.addEvents{
		'namechange',
		'sexchange'
	};
};

Ext.extend(Ext.xredman.Person, Ext.util.Observable,{
	name:'',
	sex:'',
	setName:function(_name){
		if(this.name != _name){
			this.fireEvent('namechange', this, this.name, _name);
		}
	},
	setSex:function(_sex){
		if(this.sex != _sex){
			this.fireEvent('sexchange',this, this.sex, _sex);
		}
	}
});

Ext.onReady(function(){
	var txt_username = Ext.get('usernam');
	var txt_sex = Ext.get('sex');
	_person = new Ext.xredman.Person();
	_person.on('namechange',function(_person, _old, _new){
		username.dom.value= _new;
	});
})